<template>
  <div>
    <!-- <el-descriptions v-for="(l,i) in cardList" :key="i" size="medium">
      <el-descriptions-item :label="getCardName(l)">{{ l.cardNo }}</el-descriptions-item>
      <el-descriptions-item :label="l.picInfos?'':'暂无图片附件'">{{ l.cardNo }}</el-descriptions-item>
    </el-descriptions> -->
    <div v-for="(l,i) in cardList" :key="i" style="padding: 10px; font-size: 16px;">
      <p>{{ getCardName(l) }} ： {{ l.cardNo }}</p>
      <br>
      <p v-if="!l.picInfos" style="margin-top: 10px;">{{ '暂无图片附件' }}</p>
      <div v-else class="demo-image__preview">
        <el-image
          v-for="(n,m) in l.picInfos"
          :key="m"
          style=" height: 140px; margin-right: 10px;"
          :src="`http://image.haoyunqi.com.cn/${n.url}`"
          :preview-src-list="l.picInfos.map(item=>`http://image.haoyunqi.com.cn/${item.url}`)"
          @click="console.log(`image.haoyunqi.com.cn/${n.url}`)"
        />
      </div>
    </div>
  </div>
</template>

<script>
  // import moment from 'dayjs'
  // import { colorObjMap, fromPlatColMap } from '@/utils/map'
  // import { parseTime } from '@/utils'
  import { customerAttachment } from '@/api'
  export default {

    name: 'Tab-accessory',
    props: ['csmCode', 'cardType'],
    data() {
      return {
        cardList: []
      }
    },
    methods: {
      async getData() {
        // const params = {}
        const res = await customerAttachment({ csmCode: this.csmCode })
        this.cardList = res.data.cardItems
        // this.tableData.data = res.data.rows
        // this.tableData.data.push(res.data.footer[0])
      },
      getCardName(item) {
        var obj = this.cardType.find(l => l.value === item.cardType)
        if (obj) {
          return obj.desc
        }
        return
      }
    }
  }
</script>

<style scoped>

</style>
